.todo-container {
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 900px;
  margin: 0 auto;

  .todo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;

    h2 {
      margin: 0;
      color: #333;
      font-size: 24px;
      font-weight: 600;
    }

    .todo-stats {
      display: flex;
      gap: 16px;

      span {
        padding: 4px 12px;
        background: #f5f5f5;
        border-radius: 16px;
        font-size: 12px;
        color: #666;
        font-weight: 500;

        &:nth-child(2) {
          background: #f6ffed;
          color: #52c41a;
        }

        &:nth-child(3) {
          background: #fff7e6;
          color: #fa8c16;
        }
      }
    }
  }

  .todo-input-section {
    margin-bottom: 24px;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f0;

    .input-row {
      display: flex;
      gap: 12px;
      margin-bottom: 12px;

      &:last-child {
        margin-bottom: 0;
      }

      .todo-input {
        flex: 1;
        padding: 10px 12px;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        font-size: 14px;
        transition: border-color 0.3s;

        &:focus {
          outline: none;
          border-color: #1890ff;
          box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        }

        &::placeholder {
          color: #bfbfbf;
        }
      }

      .priority-select {
        padding: 10px 12px;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        font-size: 14px;
        background: white;
        cursor: pointer;
        min-width: 120px;

        &:focus {
          outline: none;
          border-color: #1890ff;
        }
      }

      .date-input {
        padding: 10px 12px;
        border: 1px solid #d9d9d9;
        border-radius: 4px;
        font-size: 14px;
        min-width: 150px;

        &:focus {
          outline: none;
          border-color: #1890ff;
        }
      }

      .add-btn {
        padding: 10px 20px;
        background: #1890ff;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        transition: background-color 0.3s;

        &:hover {
          background: #40a9ff;
        }

        &:active {
          background: #096dd9;
        }
      }
    }
  }

  .todo-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;

    button {
      padding: 8px 16px;
      border: 1px solid #d9d9d9;
      background: white;
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
      transition: all 0.3s;

      &:hover {
        border-color: #40a9ff;
        color: #40a9ff;
      }

      &.active {
        background: #1890ff;
        border-color: #1890ff;
        color: white;
      }
    }
  }

  .todo-list {
    .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: #bfbfbf;
      font-size: 16px;
    }
  }
}

.todo-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  margin-bottom: 12px;
  background: white;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  transition: all 0.3s;

  &:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #d9d9d9;
  }

  &.completed {
    background: #f6ffed;
    border-color: #b7eb8f;

    .todo-text {
      text-decoration: line-through;
      color: #8c8c8c;
    }
  }

  &.overdue {
    border-left: 4px solid #ff4d4f;
    background: #fff2f0;
  }

  .todo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;

    .todo-main {
      display: flex;
      align-items: center;
      gap: 12px;

      .todo-checkbox {
        width: 16px;
        height: 16px;
        cursor: pointer;
      }

      .priority-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
      }

      .todo-text {
        flex: 1;
        font-size: 16px;
        color: #333;
        cursor: pointer;
        word-break: break-word;

        &:hover {
          color: #1890ff;
        }
      }

      .edit-input {
        flex: 1;
        padding: 4px 8px;
        border: 1px solid #1890ff;
        border-radius: 4px;
        font-size: 16px;

        &:focus {
          outline: none;
          box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        }
      }
    }

    .todo-meta {
      display: flex;
      gap: 16px;
      margin-left: 28px;
      font-size: 12px;
      color: #8c8c8c;

      .due-date {
        &.overdue {
          color: #ff4d4f;
          font-weight: 500;
        }
      }
    }
  }

  .todo-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;

    button {
      padding: 4px 8px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 12px;
      transition: all 0.3s;

      &.edit-btn {
        background: #e6f7ff;
        color: #1890ff;

        &:hover {
          background: #bae7ff;
        }
      }

      &.delete-btn {
        background: #fff2f0;
        color: #ff4d4f;

        &:hover {
          background: #ffccc7;
        }
      }

      &.save-btn {
        background: #f6ffed;
        color: #52c41a;

        &:hover {
          background: #d9f7be;
        }
      }

      &.cancel-btn {
        background: #f5f5f5;
        color: #8c8c8c;

        &:hover {
          background: #e6e6e6;
        }
      }
    }
  }
}

// 响应式设计
@media (max-width: 768px) {
  .todo-container {
    padding: 16px;
    margin: 16px;

    .todo-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;

      .todo-stats {
        flex-wrap: wrap;
        gap: 8px;
      }
    }

    .todo-input-section {
      .input-row {
        flex-direction: column;

        .todo-input,
        .priority-select,
        .date-input {
          width: 100%;
        }
      }
    }

    .todo-filters {
      flex-wrap: wrap;
    }

    .todo-item {
      flex-direction: column;
      gap: 12px;

      .todo-actions {
        align-self: flex-end;
      }
    }
  }
}

// 动画效果
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.todo-item {
  animation: slideIn 0.3s ease-out;
}